using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace Xeml.Document
{
    public class Experimenter : INotifyPropertyChanged
    {
        private string _firstName;

        public string FirstName
        {
            get { return _firstName; }
            set 
            {
                if (_firstName != value)
                {
                    _firstName = value;
                    OnPropertyChanged("FirstName");
                }
                
            }
        }

        private string _lastName;

        public string LastName
        {
            get { return _lastName; }
            set
            {
                if (_lastName != value)
                {
                    _lastName = value;
                    OnPropertyChanged("LastName");
                }
            }
        }

        private string _email;

        public string Email
        {
            get { return _email; }
            set
            {
                if (_email != value)
                {
                    _email = value;
                    OnPropertyChanged("Email");
                }
            }
        }

        private string _organisation;

        public string Organisation
        {
            get { return _organisation; }
            set
            {
                if (_organisation != value)
                {
                    _organisation = value;
                    OnPropertyChanged("Organisation");
                }
            }
        }

        public void Clear()
        {
            FirstName = "";
            LastName = "";
            Email = "";
            Organisation = "";
        }

        public bool IsEmpty()
        {
            return string.IsNullOrEmpty(_firstName) && string.IsNullOrEmpty(_lastName) && string.IsNullOrEmpty(_email) && string.IsNullOrEmpty(_organisation);
        }


        #region INotifyPropertyChanged Members

        protected virtual void OnPropertyChanged(string prop)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(prop));
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;

        #endregion
    }
}
